#!/usr/bin/env bash
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(doomarkable)
pkgdesc="DOOM game"
url=https://github.com/LinusCDE/doomarkable
pkgver=0.4.1-2
timestamp=2021-10-31T16:15Z
section="games"
maintainer="Linus K. <linus@cosmos-ink.net>"
license=MIT
installdepends=(display)
flags=(patch_rm2fb)

image=rust:v2.2
source=(https://github.com/LinusCDE/doomarkable/archive/0.4.1.tar.gz)
sha256sums=(d1cc2a37e769039e6e7a2f3090f77657693591a2c28ac55e51f89607d06e8b02)

build() {
    # Fall back to system-wide config
    rm .cargo/config
    cargo build --release
}

package() {
    install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/target/armv7-unknown-linux-gnueabihf/release/doomarkable
    install -D -m 644 -t "$pkgdir"/opt/etc/draft "$srcdir"/doomarkable.draft
    install -D -m 644 -t "$pkgdir"/opt/etc/draft/icons "$srcdir"/doomarkable.png
}
